package edu.pku.dao;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;
import edu.pku.data.BuyForm;
import edu.pku.data.InAskPrice;
import edu.pku.data.InReplayPrice;
import edu.pku.data.OutReplayPrice;
import edu.pku.data.Product;
import edu.pku.util.MySqlMapClient;

public class BuyFormDao {
	
	public void addBuyForm(BuyForm bf) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.insert("insert_buy_form",bf);
	}
	
	public void updateBuyForm(BuyForm bf) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.update("update_buy_form",bf);
	}
	
	public List<BuyForm> getBuyForms(String companyName) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		List<BuyForm> list =  sqlMap.queryForList("get_buy_forms",companyName);
		return list;
	}
	
	public void deleteBuyForm(BuyForm bf) throws SQLException
	{
		SqlMapClient sqlMap = MySqlMapClient.getSqlMapInstance();
		sqlMap.delete("delete_buy_form",bf);
	}
	
	
}
